#include <QApplication>
#include <QDialog>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include <QSizePolicy>
#include <QLineEdit>
#include <QPushButton>
#include <QComboBox>
#include <QDateEdit>



int main (int c, char **v)
{
	QApplication app (c, v);
	
	//parent dialog
	QDialog d (NULL);
	
	//create title 
	QLabel *title = new QLabel("PERSONAL DATA", &d);
	title -> setAlignment(Qt::AlignCenter);
	
	//create main vertical layout
	QVBoxLayout *layout = new QVBoxLayout( );
	layout -> addItem (new QSpacerItem(100, 10, QSizePolicy::Minimum) );
	
	
	//create horizontal layout for surname
	QHBoxLayout *hlayoutSurname = new QHBoxLayout( );
	//add some widget's on horizontal layout for surname
	//hlayoutSurname  -> setAlignment(Qt::AlignCenter);
	hlayoutSurname  -> addWidget (new QLabel ("surname", &d) );
	hlayoutSurname  -> addWidget (new QLineEdit ( &d ) );
	hlayoutSurname  -> addWidget (new QPushButton ("clear") );
	hlayoutSurname  -> addItem (new QSpacerItem(10, 10, QSizePolicy::Minimum) );
	
	//create horizontal layout for name
	QHBoxLayout *hlayoutName = new QHBoxLayout( );
	//add some widget's on horizontal layout for name
	//hlayoutName  -> setAlignment(Qt::AlignCenter);
	hlayoutName  -> addWidget (new QLabel ("name", &d) );
	hlayoutName  -> addWidget (new QLineEdit ( &d ) );
	hlayoutName  -> addWidget (new QPushButton ("clear") );
	hlayoutName  -> addItem (new QSpacerItem(10, 10, QSizePolicy::Minimum) );
	
	
	//create horizontal layout for date of birth
	QHBoxLayout *hlayoutDate = new QHBoxLayout( );
	//add some widget's on horizontal layout for date of birth
	hlayoutDate  -> addWidget (new QLabel ("date of birth", &d) );
	hlayoutDate -> addWidget  (new QDateEdit( ));
	hlayoutDate  -> addItem (new QSpacerItem(10, 10, QSizePolicy::Minimum) );
	
	
	//create combo box for place of birth
	QComboBox  *place = new QComboBox( );
	place -> addItem ("Australia", 1);
	place -> addItem ("Brasilia", 2);
	place -> addItem ("Canada", 3);
	place -> addItem ("Denmark", 4);
	place -> addItem ("Estonia", 5);
	place -> addItem ("France", 6);
	place -> addItem ("Georgia", 7);
	
	//create horizontal layout for place of birth
	QHBoxLayout *hlayoutPlace = new QHBoxLayout( );
	//add some widget's on horizontal layout for place of birth
	hlayoutPlace  -> addWidget (new QLabel ("place of birth", &d) );
	hlayoutPlace  -> addWidget (place);
	hlayoutPlace  -> addItem (new QSpacerItem(10, 10, QSizePolicy::Minimum) );
	
	
	//create horizontal layout for address
	QHBoxLayout *hlayoutAddress = new QHBoxLayout( );
	//add some widget's on horizontal layout for address
	hlayoutAddress  -> addWidget (new QLabel ("address", &d) );
	hlayoutAddress  -> addWidget (new QLineEdit ( &d ) );
	hlayoutAddress  -> addWidget (new QPushButton ("clear") );
	hlayoutAddress  -> addItem (new QSpacerItem(10, 10, QSizePolicy::Minimum) );
	
	
	//create horizontal layout for mobilephone
	QHBoxLayout *hlayoutMobile = new QHBoxLayout( );
	//add some widget's on horizontal layout for mobilephone
	hlayoutMobile  -> addWidget (new QLabel ("mobilephone", &d) );
	hlayoutMobile  -> addWidget (new QLineEdit ( &d ) );
	hlayoutMobile  -> addWidget (new QPushButton ("clear") );
	hlayoutMobile  -> addItem (new QSpacerItem(10, 10, QSizePolicy::Minimum) );
	
	//create horizontal layout for button's
	QHBoxLayout *hlayoutButton = new QHBoxLayout( ); 
	//add some widget's on horizontal layout for button's
	hlayoutButton -> addWidget (new QPushButton ("clear all") );
	hlayoutButton -> addWidget (new QPushButton ("save") );
	hlayoutButton -> addWidget (new QPushButton ("print") );
	hlayoutButton -> addWidget (new QPushButton ("submit") );
	hlayoutButton -> addItem (new QSpacerItem (10, 10, QSizePolicy::Minimum) );
	
	
	layout -> addWidget(title);
	layout -> addItem (hlayoutSurname);
	layout -> addItem (hlayoutName);
	layout -> addItem (hlayoutDate);
	layout -> addItem (hlayoutPlace);
	layout -> addItem (hlayoutAddress);
	layout -> addItem (hlayoutMobile);
	layout -> addItem (hlayoutButton);
	
	d.setLayout (layout);
	d.show( );
	
	return app.exec( );
	
}

